import './assets/main.css'   //全局样式css

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import axios from 'axios'
import naive from 'naive-ui'
import{ createDiscreteApi } from 'naive-ui'
import App from './App.vue'
import {router} from './router'

axios.defaults.baseURL = 'http://localhost:8080'

// discrete api
const { message, notification, dialog } = createDiscreteApi(['message', 'dialog', 'notification'])
const app = createApp(App)  //依赖注入 这里把axios放入容器中
app.provide('axios', axios)
app.provide('message', message)
app.provide('notification', notification)
app.provide('dialog', dialog)
app.use(naive)//全局注册naive-ui 不推荐

app.use(createPinia())  //挂载pinia
app.use(router)  //挂载路由

app.mount('#app') //挂载应用实例——把应用挂载到index.html的id为app的div元素页面上
